package oj;

import java.util.Scanner;

public class Day44S {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int len=0;
        while(sc.hasNext()){
            String str=sc.nextLine();
            String[] s=str.split("[^a-zA-Z]");
            StringBuilder sb=new StringBuilder();
            for(int i=s.length-1;i>=0;i--){
                sb.append(s[i]);
                if(i!=0){
                    sb.append(" ");
                }
            }
            System.out.println(sb);
        }
    }
}
